package com.yang.designmode.ActionMode.state.mario.state;

public class SuperMario implements IMario{

    private static final SuperMario instance = new SuperMario();
    private SuperMario(){}

    public static SuperMario getInstance(){
        return instance;
    }

    @Override
    public State getName() {
        return State.SUPER;
    }

    @Override
    public void obtainMushRoom(MarioStateMachine machine) {
        machine.setMario(SuperMario.getInstance());
        machine.setScore(machine.getScore() + 100);
    }

    @Override
    public void obtainCape(MarioStateMachine machine) {
        machine.setMario(CapeMario.getInstance());
        machine.setScore(machine.getScore() + 200);
    }

    @Override
    public void obtainFire(MarioStateMachine machine) {
        machine.setMario(FireMario.getInstance());
        machine.setScore(machine.getScore() + 300);
    }

    @Override
    public void meetMonster(MarioStateMachine machine) {
        machine.setMario(SmallMario.getInstance());
        machine.setScore(machine.getScore() - 100);
    }
}
